﻿using MengLin.OOP.DesignPattern.State.TrafficLights.Abstract;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.State.TrafficLights
{
    /// <summary>
    /// 上下文
    /// 状态的使用者(如：房间类，订单类)
    /// </summary>
    public class Context
    {
        /// <summary>
        /// 当前的灯
        /// </summary>
        public AbstractLight CurrentLight { get; set; }


        /// <summary>
        /// 显示
        /// </summary>
        public void Show()
        {
            CurrentLight.Show();
        }

        /// <summary>
        /// 变灯
        /// </summary>
        public void Change()
        {
            CurrentLight.Change(this);
        }
    }
}
